<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<%@ include file="/static/include/link_css.jsp"%>
<head>
    <script>
        function forword(url) {
            window.location.replace(url);
        }
    </script>

</head>
<body>
<div id="wrapper">
    <%@ include file="/static/include/header.jsp"%>
    <!--/. NAV TOP  -->
    <%@ include file="/static/include/sidebar.jsp"%>
    <!-- /. NAV SIDE  -->
    <div id="page-wrapper" >
        <div id="page-inner">
            <div class="row">
                <div class="col-md-12">
                    <h1 class="page-header">
                        订单管理
                    </h1>
                </div>
            </div>
            <!-- /. ROW  -->
            <div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                        </div>
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                    <tr>
                                        <th>订单编号</th>
                                        <th>订单状态</th>
                                        <th>订单总价</th>
                                        <th>用户ID</th>
                                        <th>联系方式</th>
                                        <th>收货地址</th>
                                        <th>下单时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach var="order" items="${orders}">
                                        <tr>
                                            <td>${order.orderno}</td>
                                                <c:if test="${order.orderstate.equals('1')}">
                                                   <td>待付款</td>
                                                </c:if>
                                                <c:if test="${order.orderstate.equals('2')}">
                                                    <td class="alert alert-warning">待发货</td>
                                                </c:if>
                                                <c:if test="${order.orderstate.equals('3')}">
                                                    <td>待收货</td>
                                                </c:if>
                                                <c:if test="${order.orderstate.equals('4')}">
                                                    <td>待评价</td>
                                                </c:if>
                                            <td>${order.totalPrice}</td>
                                            <td>${order.userno}</td>
                                            <td>${order.phone}</td>
                                            <td>${order.address}</td>
                                            <td>${order.ordetime}</td>
                                            <td>
                                                <button class="btn btn-success btn-xs" onclick="forword('/wx-shopping/detail_show/${order.orderno}')">查看订单详情</button>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                            </div>

                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
            </div>


        </div>

    </div>
    <!-- /. PAGE INNER  -->
</div>
<!-- /. PAGE WRAPPER  -->
<!-- /. WRAPPER  -->
<!-- JS Scripts-->
<%@ include file="/static/include/link_js.jsp"%>


</body>
</html>
